package kk.service;

import kk.domain.Product;

import java.util.List;

public interface ProductService {
    /**
     * 查询所有产品
     * @return
     */
    public List<Product> findAll() throws Exception;

    /**
     * 分页查询
     * @param pageNum
     * @param pageSize
     * @return
     * @throws Exception
     */
    public List<Product> findAll(Integer pageNum,Integer pageSize) throws Exception;

    /**
     * 根据id查询产品
     * @param id
     * @return
     * @throws Exception
     */
    public Product findById(Integer id) throws Exception;

    /**
     * 添加产品
     * @param product
     */
    public void save(Product product) throws Exception;

    /**
     * 根据id删除产品
     * @param id
     * @throws Exception
     */
    public void deleteById(Integer id) throws Exception;

    /**
     * 删除多个产品
     * @param ids
     * @throws Exception
     */
    public void deleteByIds(int[] ids) throws Exception;

    /**
     * 更新产品信息
     * @param product
     * @throws Exception
     */
    public void update(Product product) throws Exception;

    /**
     * 根据会员等级查询对应的推荐产品
     * @param level
     * @return
     * @throws Exception
     */
    public List<Product> findProductByLevel(String level) throws Exception;

    /**
     * 根据姓名模糊查询产品并分页
     * @param productName
     * @return
     * @throws Exception
     */
    public List<Product> findByName(Integer pageNum,Integer pageSize,String productName) throws Exception;
}
